import createApp from './create-app'
export default (context) => {
  return new Promise((resolve, reject) => {
    const { app, router } = createApp()
    console.log(router)
    router.push(context.url)
    router.onReady(() => {
      const matchedComponents = router.getMatchedComponents()
      console.log('matchedComponents:' + matchedComponents.length)
      if (!matchedComponents.length) {
        return reject(new Error('no component matched0000'))
      }
      resolve(app)
    }, reject)
  })
}
